-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PADV-1557 Adjust storage backend definition via site configurations #9
Conversation
docs/001-custom-features.md
Outdated
### Context | ||
|
||
The SGA Xblock in its upstream repository approaches the storage capability by relaying on the Django's default storage | ||
that is defined in the edx platform. Tehre's also a feature where the storage backend to be used can be defined via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is defined in the edx platform. Tehre's also a feature where the storage backend to be used can be defined via | |
that is defined in the edx platform. There's also a feature where the storage backend to be used can be defined via |
docs/001-custom-features.md
Outdated
|
||
### Feature | ||
|
||
To define a desire backend shall follow the following format by defining the storage class and it's kwargs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To define a desire backend shall follow the following format by defining the storage class and it's kwargs. | |
To define a desired backend shall follow the following format by defining the storage class and its kwargs. |
docs/001-custom-features.md
Outdated
} | ||
|
||
Once it has been done, the SGA xblocks for the given site will manage the media objects with the defined storage backend. | ||
If no settings are defined, the Xblock would use the default Django storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no settings are defined, the Xblock would use the default Django storage | |
If no settings are defined, the Xblock will use the default Django storage. |
edx_sga/tests/test_utils.py
Outdated
"region_name": "us-east-1" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing comma. @Nekenhei
docs/001-custom-features.md
Outdated
} | ||
|
||
Once it has been done, the SGA xblocks for the given site will manage the media objects with the defined storage backend. | ||
If no settings are defined, the Xblock will use the default Django storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no settings are defined, the Xblock will use the default Django storage | |
If no settings are defined, the Xblock will use the default Django storage. |
docs/001-custom-features.md
Outdated
|
||
### Feature | ||
|
||
To define a d backend shall follow the following format by defining the storage class and its kwargs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To define a d backend shall follow the following format by defining the storage class and its kwargs. | |
To define a backend shall follow the following format by defining the storage class and its kwargs. |
edx_sga/tests/test_utils.py
Outdated
"region_name": "us-east-1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing comma. @Nekenhei
edx_sga/tests/test_utils.py
Outdated
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing comma. @Nekenhei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pylint isn't notifying about the needs of this trailing comma, also, this shouldn't change in time since is a unit test focused exclusively on that scenario so no further changes on the dict shall exists. Nevertheless I understand that this is a good practice and should be applied anytime we can do so.
docs/001-custom-features.md
Outdated
|
||
### Feature | ||
|
||
To define a desire backend, follow the following format by defining the storage class and its kwargs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To define a desire backend, follow the following format by defining the storage class and its kwargs. | |
To define a desired backend, follow the following format by defining the storage class and its kwargs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird, I know you've pointed this two times and I was pretty sure I'd push it to the PR. But seems it didn't happen. Comment applied.
edx_sga/tests/test_utils.py
Outdated
"secret_key": "test_secret", | ||
"bucket_name": "test-bucket-1", | ||
"region_name": "us-east-1", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing coma. @Nekenhei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Squirrel18 according to the the PEP 8, the trailing comma is an optional standard and is recommend on those version controls where the dict is expected to change over time. Also, Pylint ain't suggesting to apply so.
I understand that is a good practice to apply the trailing commas whenever we can because there are some changes that we cannot foresee. Nevertheless, that's why on my previous response I've explained why I haven't use it. It's because this is a unit test case where no changes shall exists on the dict definitions unless the feature itself changes and in consequence the whole dict in its own format and structure will change.
I've applied the change on that line, this is comment is only to deeply explain why I haven't take those in mind during the development of the test scenario (upstream doesn't have it too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have defined it as good practice to apply trailing commas regardless of the case following PEP8.
Trailing commas have nothing to do with the fact that you don't expect the list to grow, trailing commas are a convention for version control systems, not for unit tests, so applying trailing commas does not depend on the test or any other implementation.
We have different practices than upstream, so we should follow our own practices and not depend on others.
64c9fbf
to
65c02a4
Compare
Tickets
Description
This PR adjust the upstream feature of defining storage backends but make it site-aware by defining it via site configurations.
Changes Made
How To Test
Annotations
Broken dependencies and CI process
CI process of unit testing and linting is failing due to dependencies issues. It also restrict the possibility to run it locally despite of the presence of a Tox defined workflow to do so. This is because it expects the workflows and credentials from upstream, not pearson. That could be cover in future PRs, but is not the purpose of this one so it won't be reviewed.
Unit Testing
As per the missing dependencies and challenges with Tox definition, the unit testing shall be executed thru the paltaform shell. More documentation about it can be found here.